﻿using System;

namespace IWMAG.Core.EnhancedProperties.PropertyNodes
{
    internal class DefaultValueNode<T>: PropertyNode<T>
	{
        public DefaultValueNode(T value) : base(int.MinValue) 
        {
            Value = value;
        }

        private readonly T Value;

        public override T GetNodeValue()
        {
            return Value;
        }

        public override void SuccessorChanged(T value)
        {
            throw new NotSupportedException();
        }


        public override PropertyNode<T> Next
        {
            get
            {
                return base.Next;
            }
            set
            {
                base.Next = null;
            }
        }

        public override PropertyNode<T> Previous
        {
            get
            {
                return base.Previous;
            }
            set
            {
                base.Previous = null;
            }
        }

        public override void Dispose() { }
    }
}
